<?php $this->load->view('header/admin'); ?>
<div id="main">
    <div class="container">
        <div class="span-17 colborder" id="content">
        <?php if (isset($messages)) echo $messages; ?>
            <h3 class="caps">People</h3>
	        <?php if ($person): ?>
	           <div class="span-16 last">
                    <div class="box span-5">
                        <dl>
                            <dt class="caps prepend-top">
                                <?php echo anchor('admin/people/see/'.$person->id, $person->name, 
                                    'class="person-info'.(($selected == $person->id)? ' selected' : '').'" id="person-'.$person->id.'"')?>&nbsp;
                            </dt>
                            <dd>
                                [ <?php echo anchor('admin/people/edit/'.$person->id, 'Edit', 'class="person-edit" id="person-'.$person->id.'"')?> |
                                  <?php echo anchor('admin/people/delete/'.$person->id, 'Delete', 'class="person-edit" id="person-'.$person->id.'"')?> ]
                            </dd>
                        </dl>
                    </div>
                    <div id="person-details" class="box span-9 last" style="">
	                    <dl>
                            <dt class="caps">Name: </dt> 
                            <dd id="person-name"><?php echo $person->name; ?></dd>
                            <dt class="caps prepend-top">E-Mail: </dt>
                            <dd id="person-email_primary"><?php echo $person->email_primary; ?></dd>
                            <dt class="caps prepend-top">Gender: </dt> 
                            <dd id="person-gender"><?php echo $person->gender; ?></dd>
                            <dt class="caps prepend-top">Nac Type: </dt> 
                            <dd id="person-nac_type"><?php echo $person->nac_type; ?> <?php echo $person->nac; ?></dd>
                            <dt class="caps prepend-top">Alternate E-Mail: </dt>
                            <dd id="person-email_alternate"><?php echo $person->email_alternate; ?></dd>
                            <dt class="caps prepend-top">Phone Work: </dt> 
                            <dd id="person-phone_work"><?php echo $person->phone_work; ?></dd>
                            <dt class="caps prepend-top">Phone Home: </dt> 
                            <dd id="person-phone_home"><?php echo $person->phone_home; ?></dd>
                            <dt class="caps prepend-top">Phone Mobile: </dt> 
                            <dd id="person-phone_mobile"><?php echo $person->phone_mobile; ?></dd>
                            <dt class="caps prepend-top">Address: </dt> 
                            <dd id="person-address_line_1"><?php echo $person->address_line_1; ?></dd>
                            <dd id="person-address_line_2"><?php echo $person->address_line_2; ?></dd>
                            <dt class="caps prepend-top">Location: </dt> 
                            <dd id="person-location"><?php echo $person->location; ?></dd>
                            <dt class="caps prepend-top">Postcode: </dt> 
                            <dd id="person-postcode"><?php echo $person->postcode; ?></dd>
                            <dt class="caps prepend-top">Country: </dt> 
                            <dd id="person-country_code"><?php echo $person->country_code; ?></dd>
	                    </dl>
                    </div>
                </div>
			<?php endif; ?>
			<div class="span-16">
	        <p><?php echo anchor('admin/people/add', 'Add Person')?> | <?php echo anchor('admin', 'Admin')?></p>
	        </div>
        </div> <!-- end content -->
        <?php $this->load->view('menu/admin')?>
    </div> <!-- end container -->
    <script type="text/javascript">
    $(document).ready(function() {
        /*$('#person-details').hide();
        
        $('.person-info').click(function(event) {
            event.preventDefault();
            $('#person-details').hide();
            
            var id = event.target.id.match(/^person-([0-9]+)$/);

            $.getJSON('/admin/people/ajax/view/'+id[1], function(data) {
                $.each(data, function(key, value) {
                    $('#person-' + key).html(value);
                });

                // special ones
                if (data.active)
                    $('#person-active').html('Yes');
                else
                	$('#person-active').html('No');

                // effect
                $('#person-details').fadeIn();
            });
        });*/
    });
    </script>
</div> <!-- end main -->
<?php $this->load->view('footer/standard');?>
